#include "processBar.h"

char bar[NUM]={0};
const char *ch="|/-\\";
void processbar(int cnt)
{
    if(cnt<0||cnt>END)  return;

    memset(bar,BODY,cnt);
    if(cnt<END)  bar[cnt]=TOP;

    int len=strlen(bar);
    printf(GREEN"[%-100s]"NOND"[%d%%][%c]\r",bar,cnt,ch[len%4]);
}

void Clear()
{
    memset(bar,'\0',sizeof(bar));
}
